package com.xu.sso.db.service;

import com.xu.sso.core.model.AppPathRole;
import com.xu.sso.db.model.base.App;

import java.util.List;

public interface AppDBService {

    List<AppPathRole> findAppPermissions(String appId);

    App findAppById(Integer id);

    App findAppByAppId(String appId);

    List<App> findAllApps();

    List<App> findAllStartWebApp();

    List<App> findAllServerApp();

    List<App> findAllStartApps();

    List<App> findAllUserApps(String username);

    List<App> findAllAppByLeader(String username);

    List<App> findApps(App app);

    int createApp(App app);

    int updateApp(App app);

    int deleteApp(String appId);

    boolean checkAppExist(String appId);

    boolean checkAppLeader(String appId, String username);

    int changeStatus(String appId, String status);

    int createAppUser(String appId, String username);

    int createAppUserList(String appId, List<String> usernames);

    int deleteAllAppUserByApp(String appId);

    int deleteAllAppUserByUser(String username);

    int deleteAppUser(String username, String appId);

    boolean checkAppPowerByUser(String appId, String username);

}
